<script>
onload = function () {
	document.getElementById('username').focus();
}
</script>
<body leftmargin="0" rightmargin="0" topmargin="0">
<div style=" background: url(images/title-bg.jpg); height:64px; text-align:right;">
<img src="images/head.jpg">
</div>

<!--left menu start-->
<div style="float: left; width:180px; height:100%; margin-right:20px;">
<?
include "menu.inc.php";
?>
</div>
<!--left menu end-->

<!--Main start here-->
<form name="form" action="?act=create_user" method="post" onSubmit="return GoSubmit(this)">
  <br>
  <table width="750" border="0" cellpadding="2" cellspacing="0" class="tableMainBodyFont">
    <tbody>
      <tr>
        <td width="3%" align="center" bgcolor="#aaaaaa" style=" border-top-style:solid;border-top-width:1px;"><strong>Tambah Pengguna </strong></td>
      </tr>
    </tbody>
  </table>
  <table width="750" class="tableMainBodyFont">
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>

<?
include "_form_user.php";
?>
<!--EOtelah lulus-->

<!--Main end here-->
</form>

</body>
<script>
function GoSubmit(df) {	
	if (!checkInput(anythingRegExp,document.getElementById('username'),'ID Pengguna')) return false;
	if (!checkInput(anythingRegExp,document.getElementById('passwd'),'Kata Laluan')) return false;
	if (!checkInput(anythingRegExp,document.getElementById('passwd_confirm'),'Kata Laluan Untuk Semakan')) return false;
	else {
		if (document.getElementById('passwd_confirm').value != document.getElementById('passwd').value) {
			alert("Kata laluan tidak sama.");
			return false;
		}
	}
	
	cnt = 0;
	for (i=0; i<document.forms[0].elements.length; i++ ) {
	
		if (df.elements[i].type == "checkbox") {
			if (df.elements[i].checked == 1) cnt = cnt + 1;
		}
	}
	if (cnt == 0) {
		alert("Sila Pilih Sekurang-kurangnya Satu Peranan");
		return false;
	}

	return true;
}

</script>
<? alert_some_message();?>